package com.FileClass;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Date;
import java.util.Scanner;

public class CopyFile {
    public static void main(String[] args) throws IOException {
//        LocalDateTime date = LocalDateTime.now();
//        date.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"));
//        System.out.println(date.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
//        Path path = Paths.get("D:\\Dog.txt");
////        try(Scanner scanner = new Scanner(path,StandardCharsets.UTF_8))
//        {
//            while (scanner.hasNextLine()){
//                System.out.println(scanner.nextLine());
//            }
//        }


        Path path1 = Paths.get("D:\\浏览器下载文件\\考生名单.xls");


        Path path2 = Paths.get("D:\\Atom文件\\考生名单.xls");
        if(Files.exists(path2))
            Files.delete(path2);
        Files.copy(path1,path2);









    }
}
